/**
 *
 */
package demo.tellurium.module.widget


import groovy.lang.MetaClass;

import demo.tellurium.framework.BaseUIModule;

/**
 * @author roger.xu
 *
 */
class ComboBoxDemo extends BaseUIModule {

    private static final String MODULE_NAME = "ComboBoxDemo";
    public static final String URL_KEY = "demo.list.url";

    @Override
    public String getModuleName() {
        return MODULE_NAME;
    }

    @Override
    public void defineUi() {
        ui.Container(uid: "ComboBoxDemo") {
            Container(uid: "Wrapper", clocator: [tag: "div", id: "some_div"], respond: ["click"]) {
                DOJO_ComboBox(uid: "ComboBox1", widgetid: "fruit")
            }
        }
    }

    public void doClickComboBox(int index) {
        def widgetUid = "ComboBoxDemo.Wrapper.ComboBox1";

        doSelectComboBoxItem(widgetUid, index);
    }

    public String getComboBoxValue() {
        def widgetUid = "ComboBoxDemo.Wrapper.ComboBox1";

        return onWidget(widgetUid, "getValue");
    }
}
